package com.yc.vote.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 投票系统-题目表-2
 * </p>
 *
 * @author baomidou
 * @since 2024-04-16
 */
@TableName("tp_vote")
@Data
public class Vote implements Serializable {

    private static final long serialVersionUID = 1L;

      /**
     * 编号, 自增列
     */
        @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      /**
     * 标题
     */
      private String vname;

      /**
     * 类型: 单选, 多选
     */
      private String vtype;

      /**
     * 开始时间: 开始投票的时间
     */
      private LocalDate startDate;

      /**
     * 结束时间: 投票结束的时间
     */
      private LocalDate endDate;

      /**
     * 投票发起人: 外键关联用户表id
     */
      private Integer usid;

      @TableField(exist = false)
      private List<Items> items;

    @TableField(exist = false)
    private int unum;

    private Integer status;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public List<Items> getItems() {
        return items;
    }

    public void setItems(List<Items> items) {
        this.items = items;
    }

    public Integer getId() {
        return id;
    }

      public void setId(Integer id) {
          this.id = id;
      }
    
    public String getVname() {
        return vname;
    }

      public void setVname(String vname) {
          this.vname = vname;
      }
    
    public String getVtype() {
        return vtype;
    }

      public void setVtype(String vtype) {
          this.vtype = vtype;
      }
    
    public LocalDate getStartDate() {
        return startDate;
    }

      public void setStartDate(LocalDate startDate) {
          this.startDate = startDate;
      }
    
    public LocalDate getEndDate() {
        return endDate;
    }

      public void setEndDate(LocalDate endDate) {
          this.endDate = endDate;
      }
    
    public Integer getUsid() {
        return usid;
    }

      public void setUsid(Integer usid) {
          this.usid = usid;
      }

    @Override
    public String toString() {
        return "Vote{" +
              "id = " + id +
                  ", vname = " + vname +
                  ", vtype = " + vtype +
                  ", startDate = " + startDate +
                  ", endDate = " + endDate +
                  ", usid = " + usid +
              "}";
    }
}
